//
//  ViewController.m
//  snow
//
//  Created by zhouLiHuan on 2016/12/27.
//  Copyright © 2016年 zhouLiHuan. All rights reserved.
//

#import "ViewController.h"
#import "SnowViewController.h"

@interface ViewController ()

@property (nonatomic ,strong)UITextField *onefiled;
@property (nonatomic ,strong)UITextField *secondFild;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    UITextField *onefiled = [[UITextField alloc] initWithFrame:CGRectMake(15, 100, self.view.frame.size.width - 30, 44)];
    onefiled.placeholder = @"填入表白的字";
    onefiled.backgroundColor = [UIColor lightGrayColor];
    
    [self.view addSubview:onefiled];
    self.onefiled = onefiled;
    
    UITextField *secondFild = [[UITextField alloc] initWithFrame:CGRectMake(15, 160, self.view.frame.size.width - 30, 44)];
    secondFild.placeholder = @"填入附带字";
    secondFild.backgroundColor = [UIColor lightGrayColor];
    [self.view addSubview:secondFild];
    self.secondFild = secondFild;
    
    UIButton *commitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    commitBtn.frame = CGRectMake(30, 220, self.view.frame.size.width - 60, 40);
    commitBtn.backgroundColor = [UIColor magentaColor];
    [commitBtn setTitle:@"确定" forState:UIControlStateNormal];
    [commitBtn addTarget:self action:@selector(commit) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:commitBtn];
}

- (void)commit{
    
    SnowViewController *snowVc = [[SnowViewController alloc] init];
    snowVc.oneStr = self.onefiled.text;
    snowVc.secondStr = self.secondFild.text;
    [self presentViewController:snowVc animated:YES completion:nil];
    
}

- (void)dealloc{
    NSLog(@"viewControllerDealloc");
}
@end
